'use strict'

const mongoose = require("mongoose");

module.exports = {
    name: "article",
    schema: {
        title: { type: String, required: true },
        author: mongoose.ObjectId,
        createTime: Date,
        updateTime: Date,
        viewNum: { type: Number, default: 0 },
        content: { type: String, required: true },
        description: { type: String, default: '' },
        cover: String,
        comments: [mongoose.Mixed],
        visiblePermission: Number,
        replyPermission: Number,
        published: Number,
        category: [String],
        tag: [String],
        likes: { type: Number, default: 0 },
        // 是否置顶 1：开启置顶 0：关闭置顶
        top: { type: Number, default: 0 },
        // 置顶的权重
        topIndex: { type: Number, default: 0 },
    }
};
